package com.supermarket.seefood51.activity

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.ViewGroup
import android.view.WindowManager
import android.widget.LinearLayout
import com.supermarket.pengtaosdk.utils.TimeCountDown
import com.supermarket.seefood51.R
import com.supermarket.seefood51.login.LoginActivity

class WelcomeActivity :AppCompatActivity(){
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN)

        var linear : LinearLayout = LinearLayout(this)
        linear.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT)
        linear.setBackgroundResource(R.mipmap.welcome)
        setContentView(linear)

        TimeCountDown(1000, 1000,object:TimeCountDown.TimeCountDownListener{
            override fun onTick(millisUntilFinished: Long) {

            }

            override fun onFinish() {
                startActivity(Intent(baseContext,
                        LoginActivity::class.java
                ))
                finish()
            }

        }
        ).start()

    }
}